package com.shameit.goodqrinfomanager.source.http;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;

public class NetUtils {
    public static boolean isNetworkConnected() {
        URL url;
        try {
            url = new URL("http://www.baidu.com");
            InputStream stream = url.openStream();
            stream.close();
            return true;
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return false;
    }
}
